﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Xml;

namespace SacNetUG.Models
{
    public class MissingKid
    {
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public int Age { get; set; }
        public string Image { get; set; }
        public string Status { get; set; }
        public string Police { get; set; }
        public string Phone { get; set; }
        public string City { get; set; }
        public string State { get; set; }

        public MissingKid()
        {
            
        }

        public MissingKid(XmlNode node)
        {
            int age;
            if (int.TryParse(node.Attributes["age"].Value, out age))
                Age = age;

            City = node.Attributes["city"].Value;
            FirstName = node.Attributes["firstname"].Value;
            Image = node.Attributes["medpic"].Value.Replace("img width=60 border=0 target=_new src=", "");
            LastName = node.Attributes["lastname"].Value;
            Phone = node.Attributes["policenum"].Value;
            Police = node.Attributes["policeadd"].Value.Replace(@"\", "");
            State = node.Attributes["st"].Value;
            Status = node.Attributes["status"].Value;
        }

        
    }
}
